using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for Calender
/// </summary>
namespace Business
{
    public class Calender
    {
        //
        //persian calender to miladi
        //
        public DateTime PersianToMiladi(string y, string m, string d)
        {
            System.Globalization.PersianCalendar p = new System.Globalization.PersianCalendar();
            DateTime date = p.ToDateTime(Convert.ToInt32(y), Convert.ToInt32(m), Convert.ToInt32(d), 0, 0, 0, 0);
            return date;
        }
        //
        //Miladi Calender To Persian
        //
        public string MiladiToPersian(DateTime md)
        {
            System.Globalization.PersianCalendar p = new System.Globalization.PersianCalendar();
            return string.Format("{2}/{1}/{0}", p.GetDayOfMonth(md), p.GetMonth(md), p.GetYear(md));
        }
    }
}
